/*
 * @Author: your name
 * @Date: 2021-11-24 11:43:33
 * @LastEditTime: 2022-01-25 10:28:59
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \vue-antd-admin-y\src\main.js
 */

import Vue from 'vue'
import App from './App.vue'
import { initRouter } from './router'
import './theme/index.less'
import Antd from 'ant-design-vue'
import Viser from 'viser-vue'
import '@/mock'
import store from './store'
import 'animate.css/source/animate.css'
import Plugins from '@/plugins'
import { initI18n } from '@/utils/i18n'
import bootstrap from '@/bootstrap'
import { uploading } from '@/utils/uploading'   //上传文件
import { fmtDate, sysTime, checkEmail, checkPhone, checkUserName, checkPassWord, checkNumber, checkPrice, imageUrl } from '@/utils/common'   //公共函数
import closeTabs from '@/utils/closeTabs'   //关闭标签
import 'moment/locale/zh-cn'
import VueAMap from 'vue-amap';
import moment from "moment"
import "./common.less"
Vue.prototype.$moment = moment //赋值使用 就是调用一下

moment.locale('zh-cn') // 这里是进行了汉化

const router = initRouter(store.state.setting.asyncRoutes)
const i18n = initI18n('CN', 'US')

Vue.use(Antd)
Vue.config.productionTip = false
Vue.use(Viser)
Vue.use(Plugins)


Vue.use(VueAMap);
VueAMap.initAMapApiLoader({
  key: '119f9d04c8b642f2798dd9b0691c24fd',
  plugin: [
    'AMap.Geolocation',  //定位空间，用来获取和展示用户主机所在的经纬度位置
    'AMap.Autocomplete',  //输入提示插件
    'AMap.PlaceSearch', //POI搜索插件
    'AMap.Scale',   //右下角缩略图插件，比例尺
    'AMap.OverView', //地图鹰眼插件
    'AMap.ToolBar',  //地图工具条
    'AMap.MapType',  //类别切换空间，实现默认图层与卫星图，实施交通层之间切换的控制
    'AMap.PolyEditor', //编辑 折线多边形
    'AMap.CircleEditor',
    "AMap.Geocoder"     //地图编码
  ],
  v: '1.4.4',
  uiVersion: '1.0.11'
});
Vue.prototype.closeTabs = closeTabs

Vue.prototype.uploading = uploading
Vue.prototype.fmtDate = fmtDate
Vue.prototype.sysTime = sysTime
Vue.prototype.checkEmail = checkEmail
Vue.prototype.checkUserName = checkUserName
Vue.prototype.checkPassWord = checkPassWord
Vue.prototype.checkPhone = checkPhone
Vue.prototype.checkNumber = checkNumber
Vue.prototype.imageUrl = imageUrl
Vue.prototype.checkPrice = checkPrice


bootstrap({ router, store, i18n, message: Vue.prototype.$message })

new Vue({
  router,
  store,
  i18n,
  render: h => h(App),
}).$mount('#app')

